﻿@model BankCreditPortfolio.Areas.Admin.Models.AddEmployeeModel

@{
    ViewBag.Title = "Add Employee";
}
<h2>
    Create a New Banker Account</h2>
<p>
    Use the form below to create a new banker account.
</p>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<link href="@Url.Content("~/Content/Admin/Styles/forms.css")" rel="stylesheet" type="text/css" /> 

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true, "Account creation was unsuccessful. Please correct the errors and try again.")
    <div>
        <fieldset>
            <legend>Banker Account Information</legend>
            
            <div class="editor-label">
                @Html.LabelFor(m => m.Email)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.Email)
                @Html.ValidationMessageFor(m => m.Email)
            </div>
            <div class="editor-label">
                @Html.LabelFor(m => m.Password)
            </div>
            <div class="editor-field">
                @Html.PasswordFor(m => m.Password)
                @Html.ValidationMessageFor(m => m.Password)
            </div>
            <div class="editor-label">
                @Html.LabelFor(m => m.ConfirmPassword)
            </div>
            <div class="editor-field">
                @Html.PasswordFor(m => m.ConfirmPassword)
                @Html.ValidationMessageFor(m => m.ConfirmPassword)
            </div>
            <div class="editor-label">
                @Html.LabelFor(m => m.Role)
            </div>
            <div class="editor-field">
                @Html.DropDownListFor(x => x.Role, new SelectList(ViewBag.Roles, "RoleId", "Title"))
            </div>
            <div class="editor-label">
                @Html.LabelFor(m => m.FirstName)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.FirstName)
                @Html.ValidationMessageFor(m => m.FirstName)
            </div>
            <div class="editor-label">
                @Html.LabelFor(m => m.LastName)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.LastName)
                @Html.ValidationMessageFor(m => m.LastName)
            </div>
            <div class="editor-label">
                @Html.LabelFor(m => m.MiddleName)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.MiddleName)
                @Html.ValidationMessageFor(m => m.MiddleName)
            </div>
            <div class="editor-label">
                @Html.LabelFor(m => m.PersonalId)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.PersonalId)
                @Html.ValidationMessageFor(m => m.PersonalId)
            </div>
            <div class="editor-label">
                @Html.LabelFor(m => m.PassportDate)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.PassportDate, new { @class = "datefield", id = "datefield", autocomplete = "off" })
                @*<input class="datefield" data-val="true" data-val-required="Passport date is required."  id="PassportDate" name="PassportDate" type="text" value=@DateTime.Now />
                *@@Html.ValidationMessageFor(m => m.PassportDate)
            </div>
            <div class="editor-label">
                @Html.LabelFor(m => m.PassportIssuingAuthority)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.PassportIssuingAuthority)
                @Html.ValidationMessageFor(m => m.PassportIssuingAuthority)
            </div>
            <div class="editor-label">
                @Html.LabelFor(m => m.Address)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.Address)
                @Html.ValidationMessageFor(m => m.Address)
            </div>
            <div class="editor-label">
                @Html.LabelFor(m => m.Phone)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.Phone)
                @Html.ValidationMessageFor(m => m.Phone)
            </div>
            <p>Fields marked <b>bold</b> are required</p>
            <p>                
                <input type="submit" name="button" value="Save"/>     
                <input type="button" onclick="ClickCancel();" value="Cancel" />
                <script type="text/javascript">
                    function ClickCancel() {
                        window.location = '@Url.Action("AllEmployees", "Admin")';
                    }
                </script>
            </p>
        </fieldset>
    </div>
}
